package com.wyg.epcommonbase.common.util;

import com.wyg.epcommonbase.common.exception.ExceptionEnum;
import com.wyg.epcommonbase.common.exception.MyException;
import lombok.Data;

/**
 * @Author: WangYongGan
 * @Date: 2022/3/4 13:19
 * @Description:
 */
@Data
public class AssertUtil {
    public static void  isTrue(boolean condition,int code,String msg){
        if(condition)
            throw new MyException(code,msg);
    }
    public static void  isTrue(boolean condition,MyException e){
        if(condition)
            throw  e;
    }
    public static void  isTrue(boolean condition, ExceptionEnum e){
        if(condition)
            throw new MyException(e);
    }
}

